#include <iostream>
#include <algorithm>

const int N = 1e5;

int r[N + 5], cnt[N + 5], abt[N + 5];

int main()
{
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);

    int n, ans = 0;

    std::cin >> n;
    for (int i = 1; i <= n; i++)
        std::cin >> r[i];

    std::sort(r + 1, r + n + 1);
    for (int i = 1, last = 0; i <= n; i++)
        if (r[i] != r[last])
        {
            cnt[++cnt[0]]++;
            last = i;
        }
        else
            cnt[cnt[0]]++;
    for (int i = 1; i <= cnt[0]; i++)
        abt[i] = cnt[i];
    for (int i = 1, j = 2; i <= cnt[0]; i++)
        for (j = i + 1; j <= cnt[0] && cnt[i] > 0; j++)
        {
            int s = std::min(cnt[i], abt[j]);
            cnt[i] -= s;
            abt[j] -= s;
        }
    for (int i = 1; i <= cnt[0]; i++)
        ans += cnt[i];

    std::cout << ans << "\n";

    return 0;
}
